package com.greedy.bulls.stock.trade.oauth.bo;

import com.greedy.bulls.stock.entity.user.TradeUser;
import org.springframework.security.core.userdetails.User;

import java.util.Collections;

/**
 * @Author: Yanxy
 * @Date: Created in:2023-07-12
 * Description: OAUTH2认证用户信息
 */
public class OAuthTradeUser extends User {

    private static final long serialVersionUUID = -1L;

    /**
     * 业务用户信息
     */
    private TradeUser tradeUser;

    public OAuthTradeUser(TradeUser tradeUser) {
        // OAUTH2认证用户信息构造处理
        super(tradeUser.getUserNo(), tradeUser.getUserPwd(), (tradeUser.getStatus() == 0),
                true, true, (tradeUser.getStatus() == 0),
                Collections.emptyList());
        this.tradeUser = tradeUser;
    }

    public TradeUser getTradeUser() {
        return tradeUser;
    }
}
